//package com.dhcc.bpm.modules.resource.builder;
//
//import com.dhcc.bpm.modules.resource.entity.Oss;
//import com.qiniu.common.Zone;
//import com.qiniu.storage.BucketManager;
//import com.qiniu.storage.Configuration;
//import com.qiniu.storage.UploadManager;
//import com.qiniu.util.Auth;
//import lombok.SneakyThrows;
//import org.springblade.core.oss.OssTemplate;
//import org.springblade.core.oss.props.OssProperties;
//import org.springblade.core.oss.rule.OssRule;
//import org.springblade.core.qiniu.QiniuTemplate;
//
///**
// * @ClassName QiniuBuilder.class
// * @Description  QiniuBuilder
// * @Author xiaFaYu
// * @Date 2020-02-03 14:16
// * @Version V1.0
// * @Copyright: 2020 东华软件 . All rights reserved.
// */
//public class QiniuBuilder {
//
//	@SneakyThrows
//	public static OssTemplate template(Oss oss, OssRule ossRule) {
//		Configuration cfg = new Configuration(Zone.autoZone());
//		Auth auth = Auth.create(oss.getAccessKey(), oss.getSecretKey());
//		UploadManager uploadManager = new UploadManager(cfg);
//		BucketManager bucketManager = new BucketManager(auth, cfg);
//		OssProperties ossProperties = new OssProperties();
//		ossProperties.setEndpoint(oss.getEndpoint());
//		ossProperties.setAccessKey(oss.getAccessKey());
//		ossProperties.setSecretKey(oss.getSecretKey());
//		ossProperties.setBucketName(oss.getBucketName());
//		return new QiniuTemplate(auth, uploadManager, bucketManager, ossProperties, ossRule);
//	}
//
//}
